{extend name="layout/user" /}


{block name="main"}
<link href="__STATIC__/font-awesome/css/font-awesome.min.css?page=index" rel="stylesheet" type="text/css">
<link href="__STATIC__/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css">
<script src="__STATIC__/js/bootstrap-datetimepicker.js"></script>

<div class="all-box">
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
            <li {eq name="url_path" value="share/index"}class="active"{/eq}><a href="{:url('share/index')}">今日收益</a></li>
            <li {eq name="url_path" value="share/record"}class="active"{/eq}><a href="{:url('share/record')}">财务记录</a></li>
            <li {eq name="url_path" value="share/withdraw"}class="active"{/eq}><a href="{:url('share/withdraw')}">提现记录</a></li>
        </ul>
        <fieldset>
            <div class="tabbable">
                <div class="tab-content">

                    <div class="tab-pane active">
                        <form class="well form-inline margin-top-20" method="get" action="{:url('share/index')}">
                            时间:
                            <input type="text" class="form-control input-group date form_date" data-date=""
                                   data-date-format="" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd"
                                   name="time" value="{$time}" style="width: 140px;" autocomplete="off">
                            <input type="submit" class="btn btn-primary" value="搜索">&nbsp;
                            <a onclick="shiming()"
                               style="color: #333;text-decoration: none;">实名认证</a>&nbsp;&nbsp;|&nbsp;
                            <a onclick="tixianadd()" style="color: #333;text-decoration: none;">申请提现</a>
                        </form>

                        <table class="table table-hover table-bordered">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>所属文件</th>
                                <th>浏览</th>
                                <th>下载</th>
                                <th>注册</th>
                                <th>总订单</th>
                                <th>成功订单</th>
                                <th>金额</th>
                                <th>收益</th>
                                <th>更新时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr>
                                <td>{$vo.id}</td>
                                <td>{:getFileName($vo.file_id)}</td>
                                <td>{$vo.count_view}</td>
                                <td>{$vo.count_down}</td>
                                <td>{$vo.count_reg}</td>
                                <td>{$vo.count_order}</td>
                                <td>{$vo.count_order_yes}</td>
                                <td>{$vo.count_money}</td>
                                <td>{$vo.count_profit}</td>
                                <td>{$vo.create_time|date="Y-m-d H:i"}</td>
                                <td>
                                    <a href="#" onclick="zoushitu('{$vo.file_id} ({:getFileName($vo.file_id)})','{$vo.file_id}')">走势图</a>
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                        <div class="pag">
                            {$list|raw}
                        </div>
                    </div>

                </div>
            </div>
        </fieldset>
    </div>
</div>

<script type="text/javascript">

    $('.form_date').datetimepicker({
        language: 'zh-CN',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0
    });

    function zoushitu(name = "", post_id = "") {
        layer.open({
            type: 2,
            title: '30天走势图  ' + name,
            area: ['98%', '90%'],
            shadeClose: true,
            fixed: true, //不固定
            content: '/share/echarts?id=' + post_id,
        });
    }
</script>

<script>
    function tixianadd() {
        if (window.screen.width < 768) {
            var w = '95%';
        }
        else {
            var w = '450px';
        }
        layer.open({
            type: 2,
            shadeClose: true,
            title: "申请提现",
            area: [w, '380px'], // 宽高
            content: "/user/withdraw",
            end: function () {
                //location.reload();
            },
        });
    }

    function shiming() {
        if (window.screen.width < 768) {
            var w = '95%';
        }
        else {
            var w = '480px';
        }

        layer.open({
            type: 2,
            shadeClose: true,
            title: "实名认证",
            area: [w, '300px'], // 宽高
            content: "/user/auth",
            end: function () {
                //location.reload();
            },
        });
    }
</script>
{/block}